<html>
    <script type="text/javascript">
        const ipc = require('electron').ipcRenderer
        const BrowserWindow = require('electron').remote.BrowserWindow;
        const { getLog, dealMessage } = require('./utils.js')
       
        ipc.on('get-strategy-log', function(event, {
            winId, logPath, searchKeyword
        }){
            const fromWinId = winId;
            const fromWindow = BrowserWindow.fromId(fromWinId);
            getLog(logPath, searchKeyword, dealMessage).then(({list}) => {
                fromWindow.webContents.send('res-strategy-log', list)
            }).finally(() => {
                window.close()
            })
        })

    </script>
</html>